<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h4 class="modal-title">核算报表</h4>
</div>
<form id="check-form" action="/xqc/operation/total-ajax" method="post">
    <div class="modal-body">
        <div class="row">
            <div class="form-group" style="padding-top: 30px;">
                <label style="padding-top: 3px;text-align: right;" class="col-sm-3 control-label">核算日期</label>
                <div class="col-sm-8">
                    <input type="text" id="report_date" name="param" placeholder="核算日期" required>
                </div>
            </div>
            <div class="form-group" style="padding-top: 30px;">
                <div class="col-sm-10" style="margin-left: 10%">
                <span style="color:red;">
                    <div>核算最近日期：{{ date('Y-m-d',strtotime('-3 days')) }}</div>
                    <div>默认核算日期：{{ date('Y-m-d',strtotime('-3 days')) }}</div>
                </span>
                </div>
            </div>
        </div>
    </div>
    <div class="modal-footer">
        {{ csrf_field() }}
        <input type="hidden" name="action" value="checkTotal">
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
        <button type="submit" class="btn btn-primary" id="check-submit">核算</button>
    </div>
</form>
<script language="JavaScript" type="text/javascript">
    $(function () {
        $('#report_date').datetimepicker({
            "format":"YYYY-MM-DD",
            "locale":"zh-CN",
            "allowInputToggle":true
        });
        $("#check-form").ajaxForm(function (data) {
            if (typeof data === 'object') {
                if (data.status) {
                    $("#myModal").modal('hide');
                    $(".modal-backdrop").remove();
                    $('body').removeClass('modal-open');
                    toastr.success('提交成功 !');
                    $.pjax.reload('#pjax-container');
                } else {
                    swal(data.message, '', 'error');
                }
            }
        });
    });
</script>
